<?php

class xineCodeGeneratorConfig {
	public function generateConfigFromArray ($config=array()) {
		return 'return array('.self::parseArray($config).');';
	}
	
	private static function parseArray ($array=array()) {
		$toReturn = '';
		
		foreach($array as $k1 => $v1) {
			if(is_array($v1)) {
				$parsed = self::parseArray($v1);
				$toReturn .= '\''.$k1.'\' => array('.$parsed.'), ';
			} else {
				$toReturn .= '\''.$k1.'\' => \''.$v1.'\', ';
			}
		}
		
		return $toReturn;
	}
}